import { createBrowserRouter } from "react-router-dom";
import App from "../App";
import Home from "../views/Home";
import About from "../views/About";
import Console from '../views/Console';
import UserProfile from '../views/userProfile';
import FileSource from '../views/FileSource';
import GroupManage from "../views/GroupManage";
import Login from '../views/Login';
import RouterAuth from "./RouterAuth";


const routes = createBrowserRouter([
  {
    path: '/',
    element: <RouterAuth><App /></RouterAuth>,
    children: [      
      {
        index: true,
        element: <Home />
      },
      {
        path: '/about',
        element: <About />
      },
      {
        path: '/console',
        element: <Console />
      },
      {
        path: '/userProfile',
        element: <UserProfile />,
        children: [
          {
            path: 'tom',
            element: <h3>Tom</h3>
          },
          {
            path: 'bill',
            element: <h1>Bill</h1>
          },
          {
            path: 'alex',
            element: <h3>Alex</h3>
          },
        ]
      },
      {
        path: '/fileSource',
        element: <FileSource />
      },
      {
        path: '/groupManage',
        element: <GroupManage />,
        children: [
          {
            path: 'team1',
            element: <GroupManage />
          },
          {
            path: 'team2',
            element: <GroupManage />
          },
        ]
      }

    ]
  },
  {
    path: '/login',
    element: <Login />
  }
])

export default routes;